<!--
 * @jixuanyu: jixuanyu
 * @Date: 2022-05-13 11:10:05
 * @LastEditors: jixuanyu
 * @Description: file content
-->
<template>
  <a-popconfirm
    :visible="visible"
    :cancel-button-props="cancelButtonProps"
    :ok-button-props="okButtonProps"
    :cancel-text="cancelText"
    :ok-text="okText"
    :ok-type="okType"
    :locale="locale.Popconfirm"
    :title="title"
    :disabled="disabled"
    :show-cancel="showCancel"
  >
    <slot name="default" />
    <template v-if="$slots.cancelButton">
      <slot name="cancelButton" />
    </template>
    <template v-if="$slots.icon">
      <slot name="icon" />
    </template>
    <template v-if="$slots.cancelText">
      <slot name="cancelText" />
    </template>
    <template v-if="$slots.okButton">
      <slot name="okButton" />
    </template>
    <template v-if="$slots.okText">
      <slot name="okText" />
    </template>
    <template v-if="$slots.title">
      <slot name="title" />
    </template>
  </a-popconfirm>
</template>
<script>
import { defineComponent } from 'vue'
import { Popconfirm } from 'ant-design-vue'
export default defineComponent({
  name: 'ZPopconfirm',
  components: {
    APopconfirm: Popconfirm
  },
  props: {
    cancelButtonProps: {
      type: Object,
      default: undefined
    },
    okButtonProps: {
      type: Object,
      default: undefined
    },
    cancelText: {
      type: String,
      default: undefined
    },
    okText: {
      type: String,
      default: undefined
    },
    okType: {
      type: String,
      default: 'primary'
    },
    title: {
      type: String,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false
    },
    showCancel: {
      type: Boolean,
      default: true
    },
    visible: {
      type: Boolean,
      default: undefined
    }
  }
})
</script>
